<template>
  <div class="tiaoxuan_left">
    <ul>
      <li v-for="item in lis" :key="item.id" @click="toright(item)">
        <router-link :to="'/tiaoxuanchexing/' + item.id">
          <p>{{ item.typeName }}</p>
          <p>{{ item.startPrice }}元起</p>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
// 引入请求
import { select, right } from "../../../request/select_car/select_car";
export default {
  props: {},
  data() {
    return {
      lis: [],
    };
  },
  mounted() {
    this.$store.state.list_r = []

    // 查询所有车辆类型
    select().then((res) => {
      this.lis = res.t.list;
      this.$router.push("/tiaoxuanchexing/1");
    });

    console.log('开始时间：',this.$store.state.startime+"")
    console.log('结束时间：',this.$store.state.endtime+"")
    // 查询所有车辆
    right({
      type: 1, // 车辆类型
      shopId: this.$store.state.brrowShop, // 门店id
      startTime:this.$store.state.startime,
      endTime:this.$store.state.endtime
    }).then((res) => {
      console.log(JSON.stringify(res));
      this.$store.state.list_r = res.t;
    });
  },

  methods: {
    toright(item) {
      right({
        shopId: this.$store.state.brrowShop,
        type: item.id,
        //selectId:this.$store.state.condition,
        startTime:this.$store.state.startime,
        endTime:this.$store.state.endtime
      }).then((res) => {
        console.log(JSON.stringify(res));
        this.$store.state.list_r = res.t;
      });
      this.$emit("left", item.url);
    },
  },
  components: {},
};
</script>

<style scoped lang="less">
.tiaoxuan_left {
  width: 1.49rem;
  height: 100%;
  ul {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: -0.1rem;
    .activing {
      background: white;
      div {
        border-left: 0.05rem solid #4b7ce2;
      }
    }
    li {
      width: 100%;
      height: 1.14rem;
      margin: 0.1rem 0;
      display: flex;
      align-items: center;
      .router-link-active {
        background-color: #fff;
        border-left: 0.05rem solid #4b7ce2;
      }
      a {
        width: 100%;
        height: 100%;
        padding-left: 0.23rem;
        box-sizing: border-box;
        p:first-child {
          width: 100%;
          font-size: 0.23rem;
          font-weight: 600;
        }
        p:last-child {
          font-size: 0.17rem;
          font-weight: 600;
          color: #999999;
        }
      }
    }
  }
}
</style>
